package com.lin.missyou.model;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

/**
 * @author gcq
 * @Create 2021-10-24
 */
@Entity
@Setter
@Getter
public class Category extends BaseEntity {

    @Id
    private Long id;
    private String name;
    private String description;
    private Boolean isRoot;
    private Long parentId;
    private String img;
    private Long index;
//    private Integer online;
//    private Integer level;


    /**
     * 双向多对多关系
     */
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "coupon_category",
            joinColumns = @JoinColumn(name="category_id"),
            inverseJoinColumns = @JoinColumn(name="coupon_id"))
    private List<Coupon> couponList;
}